package javalight.network.ro.server;

import java.io.IOException;
import java.io.UnsupportedEncodingException;

import org.xsocket.connection.INonBlockingConnection;

public class RequestHandler implements Runnable{

	INonBlockingConnection connection;
	public RequestHandler(INonBlockingConnection connection)
	{
		this.connection = connection;
	}
	
	@Override
	public void run() {
		
		System.out.println("recv: "+connection);
		//System.out.println(connection.getEncoding());
		try {
			System.out.println(connection.readStringByDelimiter("\n"));
		} catch (IOException e1) {
			e1.printStackTrace();
		}
		try {
			Thread.sleep(500);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}

}
